﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Core.Data.Catalog;
using Shop.Core.Domain.Catalog;

namespace Shop.Data.Mongo.Catalog
{
    public class ProductRepository : MongoRepository<Product>, IProductRepository
    {
        protected override string CollectionName
        {
            get
            {
                return "Product";
            }
        }

        public Product GetByProductId(string productId)
        {
            return this.Collection.FindAll().Where(p => p.ProductId == productId).FirstOrDefault();
        }
    }
}
